<extend name = "Common/baseView"/>
<block name="css">
    <link rel="stylesheet" href="__PUBLIC__/style/user.css">
    <link rel="stylesheet" href="__PUBLIC__/style/bootstrap.min.css">
    <script src="__PUBLIC__/js/bootstrap.min.js"></script>
    <style>
        a:hover{
            text-decoration: none;
        }
    </style>
</block>
<block name="body">

    <div class="usertable">

        <table class="table table-striped">
            <thead class="tbthead" style="background-color: #f2f2f2">
            <tr>
                <th>用户id</th>
                <th>姓名</th>
                <th>性别</th>
                <th>婚姻状态</th>
                <th>地址</th>
                <th>创建时间</th>
                <th>用户状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="user" item="v1" key="k1">
            <tr>
                <td>{$v1.id}</td>
                <td><a class="nn" href="{:U('userdetail')}?d={$v1.id}">{$v1.name}</a></td>
                <td>
                    <if condition="$v1['sex'] eq 0">
                        <?php echo "男";?>
                        <else/> <?php echo "女";?>
                        </if>
                </td>
                <td>
                    <if condition="$v1['emotion'] eq 0">
                        <?php echo "未婚";?>
                        <elseif condition="$v1['emotion'] eq 1"/>
                        <?php echo "订婚";?>
                        <elseif condition="$v1['emotion'] eq 2"/>
                        <?php echo "已婚";?>
                        <else/>
                        <?php echo "其他";?>
                    </if>
                </td>
                <td>{$v1.address}</td>
                <td><?php echo date('Y-m-d',$v1['create_time'])?></td>
                <if condition="$v1['is_use'] eq 1">
                <td><?php echo "未禁用";?></td>
                <td><a class="btn btn-danger" href="{:U('nouse')}?i={$v1.id}"><i class="fa fa-ban"></i>&nbsp;禁用</a></td>
                <else/>
                <td><?php echo "禁用";?></td>
                <td><a style="background: #009688;" class="btn btn-primary" href="{:U('useo')}?i={$v1.id}"><i class="fa fa-ban"></i>&nbsp;取消</a></td>
                </if>
                </td>
            </foreach>
            </tbody>
        </table>
    </div>
</block>
<block name="js">
    <script>
    $('#userlist').addClass("layui-this");
    $('#user').addClass("layui-nav-itemed");
    </script>
</block>